home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d20 / msgq160s.arc / NOSNOW.ASM < prev    next >
Assembly Source File  |  1991-10-26  |  1KB  |  83 lines

  1. ; No Snow screen writes for Msged/Q
  2. ; Written by P.J. Muller
  3. ; Turbo Assembler 1.0
  4.  
  5. IDEAL
  6. MODEL MEDIUM,C                ; SMALL, MEDIUM or LARGE
  7.  
  8. DOSSEG
  9. CODESEG
  10.  
  11. ; Write character and attribute without snow
  12.  
  13. ; void wrscrch(unsigned int far *addr, unsigned int chattr)
  14.  
  15. PUBLIC    wrscrch
  16. PROC    wrscrch addr:FAR PTR DWORD, chattr:WORD
  17. USES DS,ES,DI
  18.  
  19.     xor ax,ax
  20.     mov ds,ax        ; and get base address of active
  21.     mov ax,[0463h]        ; display card
  22.     add ax,6        ; add six to get status register
  23.     mov dx,ax
  24.  
  25.     les di,[addr]
  26.     mov bx,[chattr]
  27.  
  28. @@L1:    in al,dx        ; get status
  29.     test al,1        ; is it low?
  30.     jnz @@L1        ; if not, wait until it is
  31.  
  32. @@L2:    in al,dx
  33.     test al,1               ; is it high?
  34.     jz @@L2
  35.  
  36.     mov ax,bx
  37.     stosw
  38.  
  39.     ret
  40.  
  41. ENDP    wrscrch
  42.  
  43. ; Write characters and attribute without snow
  44.  
  45. ; void wrscrstr(unsigned int far *addr, char far *str, int len, BYTE attr)
  46.  
  47. PUBLIC    wrscrstr
  48. PROC    wrscrstr addr:FAR PTR DWORD, sttt:FAR PTR DWORD, len:WORD, attr:BYTE
  49. USES DS,SI,ES,DI
  50.  
  51.     xor ax,ax
  52.     mov ds,ax        ; and get base address of active
  53.     mov ax,[0463h]        ; display card
  54.     add ax,6        ; add six to get status register
  55.     mov dx,ax
  56.  
  57.     les di,[addr]
  58.     lds si,[sttt]
  59.     mov cx,[len]
  60.     mov bh,[attr]
  61.     cld
  62.  
  63. @@L0:    lodsb
  64.     mov bl,al
  65.  
  66. @@L1:    in al,dx        ; get status
  67.     test al,1        ; is it low?
  68.     jnz @@L1        ; if not, wait until it is
  69.  
  70. @@L2:    in al,dx
  71.     test al,1               ; is it high?
  72.     jz @@L2
  73.  
  74.     mov ax,bx
  75.     stosw
  76.     loop @@L0
  77.  
  78.     ret
  79.  
  80. ENDP    wrscrstr
  81.  
  82. END
  83.